package com.example.educationplatformbackend.mapper;


import com.example.educationplatformbackend.domian.home.Course;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CourseMapper {
    @Select("select * from courses")
    List<Course> course();


    @Insert("insert into courses values (null,#{course.src},#{course.title},#{course.desc1})")
    void addcourse(@Param("course") Course course);


    @Delete("delete from courses where id = #{id}")
    void deleteCourseById(@Param("id") int id);


    @Update("update courses set src=#{course.src}, title=#{course.title}, desc1=#{course.desc1} where id=#{course.id}")
    void updateCourseById( @Param("course") Course course);
}
